//
//  HJInformationTabCell.m
//  KaiChat
//
//  Created by lx on 2024/3/11.
//

#import "HJInformationTabCell.h"

@interface HJInformationTabCell()

@property (nonatomic, strong) UILabel *tabLabel;

@end


@implementation HJInformationTabCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        UILabel *titleLabel = [UILabel lableWithSuperView:self.contentView font:UIFontMake(12) color:UIColor.tj_868391Color title:nil textAlignment:NSTextAlignmentCenter];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self);
        }];
 
        _tabLabel = titleLabel;
    }
    
    self.layer.borderColor = UIColor.tj_separatorColor.CGColor;
    self.layer.borderWidth = 1;
    self.backgroundColor = UIColor.tj_F6F6F6Color;
    self.layer.cornerRadius = 4;
    self.layer.masksToBounds = true;
    return self;
}

 
- (void)setModel:(HJNewsTabModel *)model {
    _model = model;
    
    _tabLabel.text = model.tagName;
    
    if (model.isSelect) {
        self.backgroundColor = UIColor.tj_mainColor;
        self.tabLabel.textColor = UIColor.whiteColor;
        self.layer.borderWidth = 0;
    } else {
        self.layer.borderWidth = 1;
        self.backgroundColor = UIColor.whiteColor;
        self.tabLabel.textColor = UIColor.tj_333333Color;
    }
}

@end



@interface HJSelectTabCell()

@property (nonatomic, strong) UILabel *tabLabel;

@end


@implementation HJSelectTabCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        UILabel *titleLabel = [UILabel lableWithSuperView:self.contentView font:UIFontMake(12) color:UIColor.tj_868391Color title:nil textAlignment:NSTextAlignmentCenter];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self);
        }];
 
        _tabLabel = titleLabel;
    }
    
    self.layer.borderColor = UIColor.tj_separatorColor.CGColor;
    self.layer.borderWidth = 1;
    self.backgroundColor = UIColor.tj_F6F6F6Color;
    self.layer.cornerRadius = 4;
    self.layer.masksToBounds = true;
    return self;
}

 
- (void)setModel:(HJNewsTabModel *)model {
    _model = model;
    
    _tabLabel.text = model.tagName;
    
    if (model.isLike) {
        self.backgroundColor = UIColor.tj_mainColor;
        self.tabLabel.textColor = UIColor.whiteColor;
        self.layer.borderWidth = 0;
    } else {
        self.layer.borderWidth = 1;
        self.backgroundColor = UIColor.whiteColor;
        self.tabLabel.textColor = UIColor.tj_333333Color;
    }
}

@end
